home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / ibmsyn.zip / SEMFISMI.H < prev    next >
Text File  |  1992-04-21  |  3KB  |  67 lines

  1.  
  2. /* semfddmi.h */
  3.  
  4. /*****************************************************************************/
  5. /* NT IBM SDLC Adapter Device Driver: Nt-Specific Grabbage                   */
  6. /*****************************************************************************/
  7.  
  8. /*****************************************************************************/
  9. /* Power-up-selector values for reading MCA configuration from adapters.     */
  10. /*****************************************************************************/
  11.  
  12. #define POS_Adapter_Select   0x0096
  13. #define POS_AdapterID_HiByte 0x0101
  14. #define POS_AdapterID_LoByte 0x0100
  15. #define POS_ConfigByte2      0x0102
  16. #define POS_ConfigByte3      0x0103
  17.  
  18. /*****************************************************************************/
  19. /* following #defines pinched from OS2 pmsdk: os2def.h                       */
  20. /*****************************************************************************/
  21.  
  22. /* Cast any variable to an instance of the specified type. */
  23. #define MAKETYPE(v, type)   (*((type *)&v))
  24.  
  25. /* cast an expression  to any type */
  26. #define CAST(v, type)       ((type) (v))
  27.  
  28. /* Calculate the byte offset of a field in a structure of type type. */
  29. #define FIELDOFFSET(type, field)    ((SHORT)&(((type *)0)->field))
  30.  
  31. /* Combine l & h to form a 32 bit quantity. */
  32. #define MAKELONG(l, h)   ((LONG)MAKEULONG(l, h))
  33.  
  34. /* Combine l & h to form a 16 bit quantity. */
  35. #define MAKEUSHORT(l, h) (((USHORT)(l)) | ((USHORT)(h)) << 8)
  36. #define MAKESHORT(l, h)  ((SHORT)MAKEUSHORT(l, h))
  37.  
  38. /* Extract high and low order parts of 16 and 32 bit quantity */
  39. #define LOBYTE(w)       LOUCHAR(w)
  40. #define HIBYTE(w)       HIUCHAR(w)
  41. #define LOUCHAR(w)      ((UCHAR)(w))
  42. #define HIUCHAR(w)      ((UCHAR)(((USHORT)(w) >> 8) & 0xff))
  43. #define LOUSHORT(l)     ((USHORT)(l))
  44. #define HIUSHORT(l)     ((USHORT)(((ULONG)(l) >> 16) & 0xffff))
  45.  
  46. #define FIELDOFFSET(type, field)    ((SHORT)&(((type *)0)->field))
  47.  
  48. /*****************************************************************************/
  49. /* syntactic niceties                                                        */
  50. /*****************************************************************************/
  51.  
  52. #define EQ ==
  53. #define NE !=
  54.  
  55. #define BITSOFF(Val,Bits) (((Val) & (Bits)) EQ 0) //famous Russian striptease artist (hi steve)
  56.  
  57. /*****************************************************************************/
  58. /* what is BOOLean all about?  Well, ntdef.h (in public\sdk\inc) defines     */
  59. /* BOOLEAN to be a CCHAR i.e. a char.  But the result of a logical expression*/
  60. /* is an int - so casting needed every time you assign a logical value to a  */
  61. /* BOOLEAN variable.  The BOOLean is a device to document that a variable is */
  62. /* a boolean thing while avoiding conversion problems of 'BOOLEAN' typedef.  */
  63. /* (Ggggarrrhhhhh) (to quote jocky wilson).                                  */
  64. /*****************************************************************************/
  65. typedef int BOOLean;
  66.  
  67.